package com.bytenebula.asteroid;

import lombok.Getter;

@Getter
public enum ResultCodes {
    SUCCESS("SUCCESS", "成功"),
    FAILURE("FAILURE", "失败"),
    EXCEPTION("EXCEPTION", "异常"),

    INVALID_PARAMETER("INVALID_PARAMETER", "'$s'参数无效"),
    INVALID_DB_TYPE("INVALID_DB_TYPE", "无效的数据库类型: %s"),
    INVALID_COLUMN_TYPE("INVALID_COLUMN_TYPE", "无效的字段类型: %s"),

    OPERATION_FAILED("OPERATION_FAILED", "操作错误"),
    DB_OPERATION_FAILED("DB_OPERATION_FAILED", "数据库操作错误"),

    CANNOT_FIND_ACCOUNT("CANNOT_FIND_ACCOUNT", "找不到登录用户'%s'"),
    CANNOT_FILE_WAREHOURCE("CANNOT_FILE_WAREHOURCE", "找不到数据库'%s'"),
    CANNOT_FIND_META_DB("CANNOT_FIND_META_DB", "找不到数据源：%s"),

    ACCOUNT_LOGIN_FAILED("ACCOUNT_LOGIN_FAILED", "用户'%s'登录失败"),
    CREATE_TABLE_FAILED("CREATE_TABLE_FAILED", "创建数据表'%s'失败"),
    GENERATE_SQL_FAILED("GENERATE_SQL_FAILED", "生成SQL语句失败");

    private final String code;
    private final String message;

    ResultCodes(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
